package cc.lishixi.book.service.api;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.logging.Logger;

/**
 * Created by LiShixi on 2016/7/24 0024.
 * http://www.lishixi.cc
 */
@Service
public abstract class AbstractService<T> implements BaseService<T> {
    public Logger log=Logger.getLogger(getClass().getName());

    protected JdbcTemplate jdbcTemplate;

    @Override
    @Autowired
    public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
        this.jdbcTemplate = jdbcTemplate;
    }

    public abstract List<T> list();

    public abstract boolean delete(Integer id);

    public abstract boolean edit(T t);

    public abstract boolean add(T t);

}
